{{-- 继承模板 --}}
@extends('Admin/Layout/base')

{{-- 标题设置 --}}
@section('title', '星博客后台')

{{-- 内容设置 --}}
@section('content')
    
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">文章列表</div>


                </div>
                <div class="widget-body  am-fr">

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success">
                                        <a href="{{ url('admin/article-add') }}" style="color: white;width:100%;height: 100%">
                                            <span class="am-icon-plus"></span>  
                                             新增
                                        </a>       
                                     </button>
                                    {{-- <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span> 保存</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button> --}}
                                </div>
                            </div>
                        </div>
                    </div>
                    {{-- <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="am-form-group tpl-table-list-select">
                            <select data-am-selected="{btnSize: 'sm'}">
                                  <option value="option1">所有类别</option>
                                  <option value="option2">IT业界</option>
                                  <option value="option3">数码产品</option>
                                  <option value="option3">笔记本电脑</option>
                                  <option value="option3">平板电脑</option>
                                  <option value="option3">只能手机</option>
                                  <option value="option3">超极本</option>
                            </select>
                        </div>
                    </div> --}}
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                        <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                            <input type="text" class="am-form-field " placeholder="搜索文章">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button"></button>
                            </span>
                        </div>
                    </div>

                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                                <tr>
                                    <th style="width: 15%; text-align: center">封面图</th>
                                    <th style="width: 5%; text-align: center">文章ID</th>
                                    <th style="width: 35%; text-align: center">标题</th>
                                    <th style="width: 10%; text-align: center">作者</th>
                                    <th style="width: 5%; text-align: center">是否顶置</th>
                                    <th style="width: 5%; text-align: center">是否显示</th>
                                    <th style="width: 5%; text-align: center">点击量</th>
                                    <th style="width: 20%; text-align: center">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach ($articlesList as $v)
                                <tr class="gradeX" style="text-align: center">
                                    <td>
                                        <img src="{{$v['cover']}}" class="tpl-table-line-img" alt="" height="50px">
                                    </td>
                                    <td class="am-text-middle">{{$v['id']}}</td>
                                    <td class="am-text-middle">{{$v['title']}}</td>
                                    <td class="am-text-middle">{{$v['author']}}</td>
                                    <td class="am-text-middle">
                                        @if($v['is_top'] == 0)
                                            <span class="am-badge">不顶置</span>
                                        @elseif($v['is_top'] == 1)
                                            <span class="am-badge am-badge-success">顶置</span>
                                        @endif
                                    </td>

                                    <td class="am-text-middle">
                                        @if($v['display'] == 0)
                                            <span class="am-badge">不显示</span>
                                        @elseif($v['display'] == 1)
                                            <span class="am-badge am-badge-success">显示</span>
                                        @endif
                                    </td>
                                    <td class="am-text-middle">{{$v['click']}}</td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="{{ url('admin/article-edit/') . '/' . $v['id'] }}">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            {{-- <a href="javascript:;" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i> 删除
                                            </a> --}}
                                        </div>
                                    </td>
                                </tr>
                                @endforeach
                                <!-- more data -->
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">

                       {{ $articlesList->links() }}

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
 
@endsection

